package com.ler.yrmall.product.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.ler.yrmall.product.entity.CategoryEntity;
import com.ler.yrmall.product.vo.Category2VO;
import com.ler.yrmall.product.vo.CategoryVO;

import java.util.List;
import java.util.Map;

/**
 * @author leron
 */
public interface CategoryService extends IService<CategoryEntity> {

    /**
     * 树形列表
     * @return
     */
    List<CategoryVO> listWithTree();

    void removeMenuByIds(List<Long> ids);

    /**
     * 根据id获取本路径以及上级路径id
     * @param categoryId
     * @return
     */
    Long[] getCategoryPath(Long categoryId);

    /**
     * 更新
     * @param category
     */
    void update(CategoryEntity category);

    List<CategoryEntity> getLevelOne();

    Map<String, List<Category2VO>> getCatalogJson();

    /**
     * root and sub list
     * @param pid
     * @return
     */
    CategoryVO getTreeByPid(long pid);
}

